<template>
  <a-modal
    title="齐套检查"
    :width="1000"
    :visible="visible"
    :maskClosable="true"
    @cancel="handleCancel"
  >
    <v-table
      ref="table"
      :data="loadData"
      :columns="columns"
      :show-pagination='false'
      :auto-search='false'
    >
    </v-table>
  </a-modal>
</template>

<script>
import { check } from '@/api/plan/playday'

export default {
  name: 'check',
  data(){
    return {
      columns: [
        {
          title: '物料编码',
          field: 'matCode',
          type: 'input',
        },
        {
          title: '物料名称',
          field: 'matName',
          type: 'input',
        },
        {
          title: '需求数量',
          field: 'num',
          type: 'input',
        },
        {
          title: '线边数量',
          field: 'surplusNum',
          type: 'input',
        },
      ],
      loadData: () => {
        return check(this.planCode).then(res => {
          return res.data
        })
      },
      planCode: '',
      visible: false
    }
  },
  methods: {
    init(planCode){
      this.planCode = planCode
      this.visible = true

      this.$nextTick(() => {
        this.$refs.table.refresh()
      })
    },
    handleCancel(){
      this.planCode = ''
      this.visible = false
    }
  }
}
</script>

<style scoped>

</style>